// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'


export function delSupplier(id) {
  return request({
    url: '/admin/supplier/delete/' + id,
    method: 'GET',
  })
}

export function detailSupplier(id) {
  return request({
    url: '/admin/supplier/info/' + id,
    method: 'GET',
    params: {
      id
    }
  })
}


export function getSupplierList(params) {
  return request({
    url: '/admin/supplier/list',
    method: 'get',
    params
  })
}

export function addSupplier(data) {
  return request({
    url: '/admin/supplier/save',
    method: 'post',
    data,
  })
}


export function updateSupplier(data) {
  return request({
    url: '/admin/supplier/update/',
    method: 'post',
    data,
  })
}

export function delMerchant(id) {
  return request({
    url: '/admin/merchant/delete/' + id,
    method: 'GET',
  })
}

export function detailMerchant(id) {
  return request({
    url: '/admin/merchant/info/' + id,
    method: 'GET',
    params: {
      id
    }
  })
}

export function getMerchantList(params) {
  return request({
    url: '/admin/merchant/list',
    method: 'get',
    params
  })
}


export function addMerchant(data) {
  return request({
    url: '/admin/merchant/save',
    method: 'post',
    data,
  })
}


export function updateMerchant(data) {
  return request({
    url: '/admin/merchant/update/',
    method: 'post',
    data,
  })
}
export function getMerchantSubscribeList(params) {
  return request({
    url: '/admin/merchant/subscribe/list',
    method: 'get',
    params
  })
}

export function delDiscount(id) {
  return request({
    url: '/admin/discount/delete/' + id,
    method: 'GET',
  })
}


export function getDiscountList(params) {
  return request({
    url: '/admin/discount/list',
    method: 'get',
    params
  })
}


export function addDiscount(data) {
  return request({
    url: '/admin/discount/save',
    method: 'post',
    data,
  })
}


export function updateDiscount(data) {
  return request({
    url: '/admin/discount/update/',
    method: 'post',
    data,
  })
}